Skip to content

Conversation

@omkarjagtap1011
Copy link
Contributor

Summary

This PR adds the ability to use a custom rclone executable path instead of relying solely on the system PATH.

Changes

New set_executable_file() Function

  • Allows users to specify a custom path to the rclone executable
  • Includes an optional validate parameter (default: True) to verify the executable path exists
  • Raises FileNotFoundError if the path does not exist and validation is enabled
  • Validation can be bypassed with validate=False for advanced use cases

Updated is_installed()

  • Previously only checked whether rclone was available in the system PATH
  • Now also returns True if a valid custom executable path has been configured via set_executable_file()
  • Ensures functions decorated with @__check_installed work correctly when using a custom executable

Tests Added

  • test_set_executable_file()
    Verifies that the custom executable path is correctly stored

  • test_default_executable_path()
    Confirms the default executable is "rclone"

  • test_set_executable_file_validation()
    Tests executable path validation behavior

  • test_is_installed_with_custom_executable()
    Ensures is_installed() works correctly with a custom executable path

  • test_executable_used_in_command()
    Confirms that the custom executable is actually used when running rclone commands

Now, we can set the custom executable path of rclone, which was previously using system path. Useful in many applications.
@Johannes11833
Copy link
Owner

Looks good.
Could you adapt the set_executable_file test so that it runs in the automated tests? Maybe using which to get the directory that rclon is installed in? What do you think?

@omkarjagtap1011
Copy link
Contributor Author

I have check the error.

It is occuring because the test_set_executable.py contains the CUSTOM_PATH variable, which is the custom path where we want to keep the rclone binary. Currently, this path doesn't exists ( was present in my environment). Hence, test fails.

Solution Algorithm:-

  1. Create a temporary directory.
  2. Download and extract rclone binary in that directory.
  3. Perform the test where CUSTOM_PATH will point to rclone present in that temp dir.
  4. After testing, delete the temp dir.

Please review this.

@Johannes11833
Copy link
Owner

Looks good 👍
I noticed that the temp dirs are not directly removed but rather the last 3 runs are kept, but that is fine in my opinion.
I will do the code formatting once this PR is merged.

@Johannes11833 Johannes11833 merged commit dda4c52 into Johannes11833:master Jan 26, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants